<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    #con{
        border: 2px solid pink; 
        width: 400px; 
        height: 550px; 
        padding: 30px;
    } 
    .bg{
        background-color: honeydew;
    }
</style>
<body>
    <div id="con" class="list">
        <img src="001.jpg" style="width: 100%;"/>
    </div>
</body>
<script>
    //window.getComputedStyle(DOM节点对象，伪类":hover")
    //获取网页元素最终起作用的样式封装的对象
    //得到结果为只读的对象
    var con = document.getElementById("con");
    var obj = window.getComputedStyle(con);//window可以省略
    if(con.currentStyle){//判断是否为低版本的IE浏览器
        console.log(con.currentStyle["backgroundColor"]);
    }
    else{
        console.log(getComputedStyle(con));
    }
</script>
</html>